home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / bash1135 / lib / readline / makefile
Encoding:
Makefile  |  1994-02-20  |  3.9 KB  |  120 lines

  1. ## -*- text -*- ####################################################
  2. #                                   #
  3. # Makefile for the GNU Readline and History Libraries.           #
  4. #                                   #
  5. ####################################################################
  6.  
  7. # This Makefile is hand made from a template file, found in
  8. # ../template.  Each library must provide several Makefile
  9. # targets: `all', `clean', `documentation', `install', and
  10. # `what-tar'.  The `what-tar' target reports the names of the
  11. # files that need to be included in a tarfile to build the full
  12. # code and documentation for this library.
  13.  
  14. # Please note that the values for INCLUDES, CC, AR, RM, CP,
  15. # RANLIB, and selfdir are passed in from ../Makefile, and do
  16. # not need to be defined here.
  17.  
  18. # Here is a rule for making .o files from .c files that doesn't force
  19. # the type of the machine (like -sun3) into the flags.
  20. .c.o:
  21.     $(CC) -c $(CFLAGS) $(INCLUDES) $(LOCAL_DEFINES) $(CPPFLAGS) $*.c
  22.  
  23. # LOCAL_DEFINES are flags that are specific to this library.
  24. # Comment out "-DVI_MODE" if you don't think that anyone will ever desire
  25. # the vi line editing mode and features.  Define -DUSG if you are using a
  26. # System V operating system.
  27. LOCAL_DEFINES = $(LOCAL_INCLUDES) #-DVI_MODE #-DUSG
  28.  
  29. # Some systems need to define this (like older NeXT systems) in order
  30. # to prevent namespace conflicts.
  31. CFLAGS = # -DSTATIC_MALLOC
  32.  
  33. # For libraries which include headers from other libraries.
  34. LOCAL_INCLUDES = -I. -I../
  35.  
  36. # The name of the main library target.
  37. LIBRARY_NAME = libreadline.a
  38.  
  39. # The C code source files for this library.
  40. CSOURCES = readline.c funmap.c keymaps.c vi_mode.c parens.c \
  41.        rltty.c complete.c bind.c isearch.c display.c signals.c \
  42.        emacs_keymap.c vi_keymap.c history.c tilde.c xmalloc.c
  43.  
  44. # The header files for this library.
  45. HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h \
  46.        posixstat.h tilde.h
  47.  
  48. OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
  49.       rltty.o complete.o bind.o isearch.o display.o signals.o \
  50.       history.o tilde.o xmalloc.o
  51.  
  52. # The texinfo files which document this library.
  53. DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
  54. DOCOBJECT = doc/readline.dvi
  55. DOCSUPPORT = doc/Makefile
  56. DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
  57.  
  58. SUPPORT = Makefile ChangeLog $(DOCSUPPORT) examples/[-a-z.]*
  59.  
  60. SOURCES  = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
  61.  
  62. THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
  63.  
  64. ##########################################################################
  65.  
  66. all: libreadline.a libhistory.a
  67.  
  68. libreadline.a: $(OBJECTS)
  69.     $(RM) $@
  70.     $(AR) cr $@ $(OBJECTS)
  71.     -if [ -f "$(RANLIB)" ]; then $(RANLIB) $@; fi
  72.     $(RM) $(patsubst lib%.a,%.olb,$@)
  73.     ln $@ $(patsubst lib%.a,%.olb,$@)
  74.  
  75. libhistory.a: history.o
  76.     $(RM) $@
  77.     $(AR) cr $@ history.o
  78.     -if [ -f "$(RANLIB)" ]; then $(RANLIB) $@; fi
  79.     $(RM) $(patsubst lib%.a,%.olb,$@)
  80.     ln $@ $(patsubst lib%.a,%.olb,$@)
  81.  
  82. what-tar:
  83.     @for file in $(THINGS_TO_TAR); do \
  84.       echo $(selfdir)$$file; \
  85.     done
  86.  
  87. documentation: force
  88.     make -C doc
  89. force:
  90.  
  91. # The rule for 'includes' is written funny so that the if statement
  92. # always returns TRUE unless there really was an error installing the
  93. # include files.
  94. install:
  95.     if [ -r $(incdir)/readline ]; then \
  96.       :; \
  97.     else \
  98.       mkdir $(incdir)/readline && chmod a+r $(incdir)/readline; \
  99.     fi
  100.     $(CP) readline.h keymaps.h chardefs.h history.h $(incdir)/readline/
  101.     -mv $(bindir)/libreadline.a $(bindir)/libreadline.old
  102.     cp libreadline.a $(bindir)/libreadline.a
  103.     if [ -f "$(RANLIB)" ]; then $(RANLIB) -t $(bindir)/libreadline.a; fi
  104.  
  105. clean:
  106.     rm -f $(OBJECTS) *.a
  107.     make -C doc clean
  108.  
  109. readline: readline.h rldefs.h chardefs.h
  110. readline: $(OBJECTS)
  111.     $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
  112.       $(LOCAL_INCLUDES) -DTEST -o readline readline.c vi_mode.o funmap.o \
  113.       keymaps.o -ltermcap
  114.  
  115. readline.o: readline.c readline.h rldefs.h chardefs.h
  116. readline.o: keymaps.h history.h
  117. vi_mode.o:  vi_mode.c
  118. funmap.o:   funmap.c readline.h
  119. keymaps.o:  keymaps.c emacs_keymap.c vi_keymap.c keymaps.h chardefs.h
  120.